{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}
{% import "_my_wtf_macros.html" as my_wtf_macros %}
{% import "user/partial/user_table.html" as user_table_macro %}

{% block title %}万屏时代OPC--客户奖品兑换列表{% endblock %}

{% block panel_heading %}
  万屏时代OPC--客户奖品兑换列表
{% endblock %}

{% block panel_body %}
    <form  action="{{ url_for('op_bp.game_reward') }}"
          method="post" class="form" role="form">
        {{ my_wtf_macros.form_field(form.status, div_col=4, label_col=4, field_col=7) }}
        <div class="clearfix visible-xs-block visible-sm-block visible-md-block visible-lg-block"></div>
        <div class="pull-right btn-group">
            <button type="submit" class="btn btn-info"
                    id="query-demand-btn">
                查询
            </button>

        </div>
    </form>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.game_reward', **url_kwargs) }}
    </div>
    {% endif %}
    <table id="cancel-attention-user-info-table" class="table table-bordered table-hover table-condensed table-striped">
        <thead>
            <tr>
                <th>ID</th>
                <th>用户名</th>
                <th>手机</th>
                <th>兑换商品</th>
                <th>兑换数量</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for each in records %}
            <tr>
                <td>{{ each.id }}</td>
                <td>{{ each.users.nickname }}</td>
                <td>{{ each.users.mobile | encrypt }}</td>
                <td>{{ each.name }}</td>
                <td>{{ each.count }}</td>
                <td>{{ each.status_display }}</td>
                <td>
                    {% if each.status == 0 %}
                    <a
                            class="btn btn-xs btn-danger" style="margin: 3px;"
                            href="{{ url_for('op_bp.game_reward_edit', game_id = each.id) }}"
                            target="_self"
                            onclick="return confirm('确认已兑换？')"
                    >确认兑换</a>
                    {% endif %}
                </td>
            </tr>
            {% endfor %}
        </tbody>

    </table>

    {% if pagination %}
    <div class="pagination">
        {{ macros.pagination_widget(pagination, 'op_bp.game_reward', **url_kwargs) }}
    </div>
    {% endif %}

{% endblock %}

